const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const UserSchema = new Schema({
    username: {
        type: String,
        require: true
    },
    password: {
        type: String,
        require: true
    },
    role: {
        type: Number,
    },
    avatar: {
        type: String,
        default: '/images/avatar.jpg'
    },
    createTime: {
        type: Date,
        default: Date.now
    },
    desc: {
        type: String,
        default: '一个无描述的用户...'
    }
});

module.exports = mongoose.model('User', UserSchema);
